/*!*********************************************************************************
 * X2Engine Open Source Edition is a customer relationship management program developed by
 * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
 * California 94061, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2 Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2 Engine".
 **********************************************************************************/






/**
 * CSS styles for forms generated by yiic.
 *
 * The styles can be applied to the following form structure:
 *
 * <div class="form">
 *   <div class="row">
 *       <label for="inputid">xyz</label>
 *       <input name="inputid" id="inputid" type="text" />
 *       <p class="hint">hint text</p>
 *   </div>
 *   <div class="row">
 *       <label for="inputid">xyz</label>
 *       <input name="inputid" id="inputid" type="text" />
 *       <p class="hint">hint text</p>
 *   </div>
 *   <div class="row buttons">
 *       <label for="inputid">xyz</label>
 *       <input name="inputid" id="inputid" type="text" />
 *       <p class="hint">hint text</p>
 *   </div>
 * </div>
 *
 * The above code will render the labels and input fields in separate lines.
 * In order to render them in the same line, please use the "wide" form as follows,
 *
 * <div class="wide form">
 *   ......
 * </div>
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright Copyright &copy; 2008-2010 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

@import "x2-icons";
@import "icons";
@import "standards";

#form-box {
    background: #f8f8f8;
    border: 1px solid #ccc;
    -moz-border-radius: 4px;
    -o-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    div {
        &.draggable {
            /* background:white; */
        }
        &.label {
            font-size: 10px;
            color: #666;
            /* font-weight:bold; */
            /* display:block;
            width:auto;
            padding:1px 3px; 
            background:#eee;
            border:1px solid #ccc;
            -moz-border-radius:3px;
            -o-border-radius:3px;
            -webkit-border-radius:3px;
            border-radius:3px; */
        }
    }
    font-weight: bold;
}

.form .CodeMirror {
    border: 1px solid $lightGray;
    margin-bottom: 5px;
}

div {
    &.form, &.wide.form, &.form2 {
        background: #fff;
        clear: both;
        padding: 5px 10px;
        width: auto;
        overflow: auto;
        
        -moz-border-radius: 0px !important;
        -o-border-radius: 0px !important;
        -webkit-border-radius: 0px !important;
        border-radius: 0px !important;
        
        border: none !important;
        margin: 0 0 5px 0 !important;
    }
}

#content {
    & > div.form {
        -moz-border-radius: 0;
        -o-border-radius: 0;
        -webkit-border-radius: 0;
        border-radius: 0;
        border-width: 0 0 1px 0;
        margin: 0;
    }
}

div {
    &.form.no-border, &.wide.form.no-border {
        border: none;
        padding: 0;
        background: none;
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    &.form, &.form2 {
        .x2-protected-field {
            color: grey;
        }
        label + [type="checkbox"] {
            position: relative;
            top: -2px;
            left: 2px;
            & + .x2-hint {
                margin-left: 3px;
            }
        }
        label + span.x2-hint {
            margin-left: 3px;
        }
        &.hidden {
            display: none;
        }
        &.details a {
            text-decoration: none;
        }
        &.no-border {
            input, textarea, select, button {
                margin: 0;
            }
        }
        &.thin {
            border: none;
            padding: 3px;
            margin: 0 0 5px 0;
            input, textarea, select {
                margin: 3px 0;
                padding: 2px 4px;
            }
        }
        input, textarea {
            border: 1px solid #d3d3d3;
        }
    }
}

.ui-dialog input {
    border: 1px solid #d3d3d3;
}

body.not-mobile-body div.form input:not(.highlight), body.not-mobile-body div.form textarea, body.not-mobile-body div.form select, .form2 input:not(.highlight), .form2 textarea, .form2 select {
    background: white;
}

body.not-mobile-body div.form, .form2 {
    select {
        border: 1px solid #d3d3d3;
        color: #555555;
        text-decoration: none;
        
        option {
            background: white;
        }
    }
    input:not(.highlight), textarea, select {
        margin: 3px 0 5px 0;
        -moz-border-radius: 3px;
        -o-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        /* @theme background: content */
    }
    input:not(.highlight), textarea {
        margin: 3px 0 5px 0;
        -moz-border-radius: 3px;
        -o-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
    }
}

.ui-dialog input {
    margin: 3px 0 5px 0;
    -moz-border-radius: 3px;
    -o-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

/*div.form input, div.form textarea {
    -webkit-appearance:none;
}*/

div.form, .form2 {
    input {
        &[type="checkbox"] {
            -webkit-appearance: checkbox;
            &.left + label {
                line-height: 18px;
                padding-left: 16px;
            }
        }
        + .x2-question-mark {
            margin-left: 2px;
            position: relative;
            top: -3px;
        }
    }
    select + .x2-question-mark {
        margin-left: 2px;
        position: relative;
        top: -3px;
    }
}

label.left + .x2-hint {
    margin-left: 3px;
}

div.form, .form2 {
    input {
        &[type="button"], &[type="submit"] {
            -webkit-appearance: button;
        }
        &[type="file"] {
            /*border:none;*/
        }
    }
    fieldset {
        -moz-border-radius: 7px;
        border: 1px solid #F5F5F5;
        margin: 0 0 10px 0;
        padding: 10px;
    }
}

table.details td.label {
    font-size: 11px;
    font-weight: bold;
}

div.form, .form2 {
    label {
        display: block;
        font-size: 11px;
        font-weight: bold;
        & + .x2-hint {
        }
    }
    .left-checkbox {
        float: left;
        margin-right: 2px;
        + label {
            margin-top: 3px;
        }
    }
    .left-label {
        float: left;
        margin-top: 7px;
        margin-right: 2px;
        + input {
            &[type='checkbox'], + input[type='checkbox'] {
                margin-top: 7px;
                margin-bottom: -7px;
                margin-left: 3px;
            }
        }
        & + .x2-hint {
            margin-top: 7px;
        }
    }
    textarea {
        /* overflow:hidden; */
    }
    .top.row {
        margin-top: 10px;
    }
    .row {
        width: auto;
        clear: both;
        overflow: auto;
    }
    .cell {
        display: block;
        float: left;
        margin-right: 5px;
        color: #555555;
        
        &.right {
            float: right;
            width: 200px;
        }
    }
    .hint {
        color: #999;
        margin: 0;
        padding: 0;
    }
    .note {
        font-style: italic;
    }
    span.required {
        color: red;
    }
    div.error:not(.x2-pill-box) label, label.error, span.error {
        color: #C00;
    }
    div.error:not(.x2-pill-box) {
        input, textarea, select {
            background: #FEE;
            border-color: #C00;
        }
    }
    input.error, textarea.error, select.error {
        background: #FEE;
        border-color: #C00;
    }
}

.ui-dialog input.error {
    background: #FEE;
    border-color: #C00;
}

/* div.form div.success input,div.form div.success textarea,div.form div.success select,div.form input.success,div.form textarea.success,div.form select.success {
    background: #E6EFC2;
    border-color: #C6D880;
} */

div.form, .form2 {
    .errorSummary {
        background: #FEE;
        border: 2px solid #C00;
        font-size: 0.9em;
        padding: 7px 7px 12px 24px;
    }
    .error-text {
        color: red;
    }
    .errorMessage {
        color: red;
        font-size: 0.9em;
    }
    .errorSummary {
        p {
            margin: 0;
            padding: 5px;
        }
        ul {
            margin: 0;
            padding: 0 0 0 20px;
        }
    }
}

div {
    &.row input[type=text].focus, &.formInputBox input[type=text].focus {
        background: #E6EFC2;
        border-color: #C6D880;
    }
    &.wide.form label {
        display: inline;
        float: left;
        margin-right: 10px;
        position: relative;
        text-align: right;
        width: 100px;
    }
}

.wide.cell label {
    display: inline;
    float: left;
    margin-right: 10px;
    position: relative;
    text-align: right;
    width: 100px;
}

div.form .background-row {
    width: 350px;
    display: block;
    a.delete-link {
        width: auto;
        color: #06c;
        float: right;
        background: none;
    }
}

/*
 * styles admin panel tabs according to window width
 **/
.admin-screen .ui-tabs-vertical .ui-tabs-nav li a div .admin-tab-word  {
    @media screen and (max-width: 1200px) {
        display:none;
    }
    @media screen and (max-width: 800px) {
        display:none;
    }        
}

.admin-screen {
    div.x2-layout-island h2 {
        background-repeat: no-repeat;
        background-position: middle left;
        background-color: transparent;
        line-height: 48px;
    }


    h2 {

        &::after, &::before {
            font-size: 40px !important;
            width: 55px;
            height: 48px;
            text-align: center;
            vertical-align: middle;

        }
    }

    div {
        margin-left: 10px;
        padding-top: 0px;
        padding: 5px;

        &::after, &::before {
            font-size: 25px !important;
            text-align: center;
            vertical-align: middle;
            float: left;
        }
    }
}

div {
    &.form {
        select[multiple="multiple"] {
            /*min-width:130px;*/
        }
        textarea {
            width: 556px;
            padding: 2px 4px;
        }
    }
    &.text-area-wrapper {
        width: auto;
        margin: 0 0 5px 0;
        padding: 2px 4px;
        @include border-radius (2px);
        border: 1px solid #aaa;
        background: #fff;
        &.error {
            background: #FEE !important;
            border-color: #C00 !important;

            /* @theme background: content */
        }
        textarea {
            width: 100%;
            margin: 0;
            padding: 0 !important;
            border: none;
        }
    }
    &.form, &.form2 {
        input, textarea, button {
            font-size: 12px;
            font-family: Arial, Helvetica, sans-serif;
            padding: 2px 4px;
            color: #555555;
        }
    }
}

.ui-dialog input {
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    padding: 2px 4px;
}

div.form, .form2 {
    input.x2-button, button.x2-button {
        padding: 5px 20px;
    }
    input.x2-button.small, button.x2-button.small {
        padding: 5px 10px;
    }
    .row.checkbox {
        label, input {
            display: inline;
        }
    }
}

.cell.checkbox {
    label, input {
        display: inline;
    }
}

div {
    &.wide.form .row {
        clear: both;
    }
    &.form, &.form2 {
        .row.buttons {
            input, button, select, a.x2-button {
                float: left;
                margin: 0 10px 0 0;
            }
        }
        .float-row {
            overflow: auto;
            input, button, select {
                float: left;
                margin: 0 10px 0 0;
            }
        }
        .row.buttons {
            /* margin-top:10px; */
        }
    }
    &.wide.form {
        .buttons, .hint, .errorMessage {
            clear: left;
            padding-left: 110px;
        }
    }
}

.file-wrapper {
    display: inline-block;
    overflow: hidden;
    position: relative;
    input {
        height: 100%;
        position: absolute;
        right: 0;
        top: 0;
        filter: alpha(opacity = 50);
        -moz-opacity: 0.01;
        opacity: 0.01;
    }
}

.x2-file-wrapper {
    display: inline-block;
    overflow: visible;
    position: relative;
}

.x2-file-input {
    cursor: pointer;
}

.x2-file-wrapper .x2-file-input {
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    font-size: 100%;
}

.x2-file-wrapper {
    .x2-file-input {
        filter: alpha(opacity = 1);
        -moz-opacity: 0.01;
        opacity: 0.01;
        z-index: 100;
    }
    .filename {
        position: absolute;
        filter: alpha(opacity = 0);
        -moz-opacity: 0.00;
        opacity: 0.00;
        left: 10px;
    }
}

#campaign-attachments {
    margin-right: 0;
    margin-bottom: 0;
    &.x2-state-active, &.x2-state-hover {
        box-shadow: inset 0 0 4px 1px #579100;
    }
}

.x2-state-active, .form.x2-state-active {
    background: #c9dda1 !important;
    /*@theme background: opaque_highlight2 */
}

.x2-state-hover, .form.x2-state-hover {
    background: #acce67 !important;
}

html {
    .cke_skin_kama {
        &.ui-state-active .cke_wrapper {
            background: #c9dda1;
            box-shadow: inset 0 0 4px 1px #579100;
        }
        &.ui-state-hover .cke_wrapper {
            background: #acce67;
            box-shadow: inset 0 0 4px 1px #579100;
        }
    }
    .cke_contents iframe {
        -moz-border-radius: 5px;
        -o-border-radius: 5px;
        -webkit-border-radius: 5px;
        border-radius: 5px;
    }
    span.cke_skin_kama {
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;
        border-radius: 5px;
        border: 1px solid #ccc;
        padding: 0;
        &#cke_Campaign_content {
            -moz-border-radius: 0px;
            -webkit-border-radius: 0px;
            border-radius: 0px;
            border: none;
        }
    }
    .cke_skin_kama {
        .cke_wrapper {
            background-image: none;
            background-color: #eee;
        }
        .cke_focus {
            outline: none;
        }
    }
}


/***********************************************************************
* form2  
***********************************************************************/

.form2 {
    background: white;
    /* @theme background: content */
    textarea, label {
        /* @theme color: text */
    }
}

.form2, .all-form-input-style {
    input.left-input {
        display: inline-block;
    }
    input + .right-label {
        margin-left: 2px;
        position: relative;
        top: -2px;
        display: inline-block;
    }
    label.left-label + input {
        margin-left: 2px;
    }

    label + .x2-hint {
        margin-left: 4px;
    }
    label {
        font-size: 11px;
        color: #222;
        font-weight: bold;
    }
    input[type="text"] {
        padding: 2px 4px;
        -moz-border-radius: 3px;
        -o-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        border: 1px solid #d3d3d3;
    }
}


/*********************************
* Inline Editing
********************************/
.inline-edit {

    .inline-edit-icons {
        float: none;
        vertical-align: middle;

        position: absolute;
        top: 5px;
        right: 0px;

        font-size: 14px;
        transition: all 0.1s;
    }

    .cancel-icon, 
    .confirm-icon {
        margin-right: 4px;
    }

    .edit-icon {
        display: none;
        width: 0;
        margin-right: 3px;

        &.active {
            opacity: 0.0;
            width: 0px;
            overflow: hidden;
        }
    }

    &:hover .edit-icon.active {
        opacity: 1.0;
        width: 15px;
        display: inline-block;
    }

    .cancel-icon, 
    .confirm-icon {
        opacity: 0.0;
        display: none;
        transition: opacity 0.2s;

        &.active {
            opacity: 1.0;
            display: inline-block;
        }
    }
}
